Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle closures #66

Merged
merged 1 commit into from
Jun 10, 2021
Merged

Handle closures #66

merged 1 commit into from
Jun 10, 2021

Conversation

wsmoses
Copy link
Member

@wsmoses wsmoses commented Jun 1, 2021

Fixes #62

@wsmoses wsmoses requested a review from vchuravy June 1, 2021 21:23
src/compiler.jl Outdated

struct CombinedAdjointThunk{f, RT, TT}
Fn::f
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Julia convention is capitalization the other way around fn::F

src/compiler.jl Outdated

@generated function enzyme_call(f::Ptr{Cvoid}, tt::Type{T}, rt::Type{RT}, args::Vararg{Any, N}) where {T, RT, N}
@generated function enzyme_call(f::Ptr{Cvoid}, F::FTy, tt::Type{T}, rt::Type{RT}, args::Vararg{Any, N}) where {FTy, T, RT, N}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@generated function enzyme_call(f::Ptr{Cvoid}, F::FTy, tt::Type{T}, rt::Type{RT}, args::Vararg{Any, N}) where {FTy, T, RT, N}
@generated function enzyme_call(ptr::Ptr{Cvoid}, f::F, tt::Type{T}, rt::Type{RT}, args::Vararg{Any, N}) where {F, T, RT, N}

return f(x)
end

struct AFoo
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remains to test:

  • mutable struct
  • Duplicated on struct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enzyme crash for simple user struct type
2 participants